home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Ebooks / Thinking in C++ V2 / C04 / CppLib.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-25  |  595 b   |  22 lines

  1. //: C04:CppLib.h
  2. // From Thinking in C++, 2nd Edition
  3. // Available at http://www.BruceEckel.com
  4. // (c) Bruce Eckel 1999
  5. // Copyright notice in Copyright.txt
  6. // C-like library converted to C++
  7.  
  8. struct Stash {
  9.   int size;      // Size of each space
  10.   int quantity;  // Number of storage spaces
  11.   int next;      // Next empty space
  12.    // Dynamically allocated array of bytes:
  13.   unsigned char* storage;
  14.   // Functions!
  15.   void initialize(int size);
  16.   void cleanup();
  17.   int add(const void* element);
  18.   void* fetch(int index);
  19.   int count();
  20.   void inflate(int increase);
  21. }; ///:~
  22.